package rexsee.core.browser.clazz;

import java.util.ArrayList;

import rexsee.core.browser.Browser;

public class PageBeforeStartListeners {
	private final ArrayList<PageBeforeStartListener> listeners;
	public PageBeforeStartListeners() {
		listeners = new ArrayList<PageBeforeStartListener>();
	}
	public void add(PageBeforeStartListener listner) {
		listeners.add(listner);
	}
	public void remove(PageBeforeStartListener listner) {
		listeners.remove(listner);
	}
	public void clear() {
		listeners.clear();
	}
	public void run(Browser browser, String url) {
		for (int i = 0; i < listeners.size(); i++)
			listeners.get(i).run(browser, url);
	}
	public static abstract class PageBeforeStartListener {
		public abstract void run(Browser browser, String url);
	}
}
